Create order
Details
Used to create a new giftcard order(s).
URL : <base_url>/reseller/orders
Method : POST
Authentication required : YES
Request parameters
In the request URL, provide the following parameter in the URL
Parameter | Type | Example | Description |
---|---|---|---|
cashier_pin | integer | 123456 | required. |
orders | array | required. | |
orders.*.sender_name | string | Jon Snow | optional. |
orders.*.receiver_name | string | Jane Snow | optional. |
orders.*.receiver_phone | string | +18767654321 | conditional. |
orders.*.receiver_email | string | example@example.com | conditional. |
orders.*.amount | string | 5000 | required. |
orders.*.self_deliver | string | true | optional. |
orders.*.descriptor | string | optional. | |
orders.*.identifier | string | optional. | |
orders.*.context | string | all,merchant,category | required. |
orders.*.giftcards | array | [1,2] | optional. |
Receiver email required if phone is not present Receiver phone required if email is not present
Success Response
Code : 200 OK
Content :
{
"success": true,
"data": [
{
"sender_name": "Jon Snow",
"sender_phone": null,
"receiver_name": "Romario Hall",
"receiver_phone": "+18767728111",
"amount": 11000,
"ticket": true,
"self_deliver": true,
"identifier": null,
"descriptor": null,
"status": "complete",
"code": "445675018167",
"link": "https://staging.giftme.link/4kjzN?pin=7286",
"pin": "7286"
},
{
"sender_name": "Jon Snow",
"sender_phone": null,
"receiver_name": "Romario Hall",
"receiver_phone": "+18767728111",
"amount": 13000,
"ticket": false,
"self_deliver": false,
"identifier": null,
"descriptor": null,
"status": "complete",
"code": "200706492924",
"link": "https://staging.giftme.link/NDZle?pin=2475",
"pin": "2475"
}
]
}
Error Responses
Condition : Missing amount.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"orders.0.amount": [
"The orders.0.amount field is required."
]
}
}
Condition : Missing receiver phone number.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"orders.1.receiver_phone": [
"The orders.1.receiver_phone field is required."
]
}
}
Condition : Cashier.
Code : 400 BAD REQUEST
Content :
{
"message": "The given data was invalid.",
"errors": {
"cashier_pin": "Invalid cashier pin."
}
}